import React, { useState } from "react";
import { useHistory } from "react-router-dom";
const my_1 = "https://lcz-quna.oss-cn-beijing.aliyuncs.com/img/mini1.png"
const my_2 = "https://lcz-quna.oss-cn-beijing.aliyuncs.com/img/mini2.png"
const s_top = "https://lcz-quna.oss-cn-beijing.aliyuncs.com/img/mini_top.png"
const X = "https://lcz-quna.oss-cn-beijing.aliyuncs.com/img/x.png"
function Home() {
  const history = useHistory();
  const [isF, setIsF] = useState(false);
  const [list] = useState([
    {
      img: my_1,
      name: "图片",
    },
    {
      img: my_2,
      name: "游戏",
      url: "https://lcz-quna.oss-cn-beijing.aliyuncs.com/img/jishigonglue.jpg"
    }
  ]);
  return (
    <div className="home my">
      <div className="back">
        <img onClick={() => { history.go(-1) }} src={X} />
      </div>
      <div className="ban1">
        <img src={s_top} />
      </div>
      <div className="home_main my_main">

        <div className="home_con">

          <div className="my_con_all">
            {list?.map((item, index) => {
              return (
                <div key={index}>
                  <img
                    onClick={() => {
                      if (item.name == "图片") {
                        history.push("/list/minitiaozhan")
                      }
                      if (item.name == "游戏") {
                        // setIsF(true)
                        window.location.href = "https://23374927-140.hd.ysfaisco.cn/23374927/sbYsyNA-ihHa-aYaV3fHXQ/load-23374927-140.html?style=11&_source=1"
                      }
                    }}
                    src={item.img}
                  />
                </div>
              );
            })}
          </div>
        </div>
      </div>
      {isF && <div className="myIf_box">
        <div className="back">
            <img onClick={() => { setIsF(false); }} src={X} />
          </div>
        <iframe className="myIf" src="https://23374927-140.hd.ysfaisco.cn/23374927/sbYsyNA-ihHa-aYaV3fHXQ/load-23374927-140.html?style=11&_source=1"></iframe>
      </div>}
    </div>
  );
}

export default Home;
